<?php
include("helper/connexion.php");
include("helper/enseignement_helper.php");
connexion_sql();
$idoption = (int) $_POST['idoption'];
$idformation = (int) $_POST['idformation'];

suppressionOption($idoption, $idformation);
?>
 <div class="accordion-inner">
         
			  <?php
			  $req2 = getOption($idformation);
			  while($rowOption = pg_fetch_assoc($req2)){
			  ?> 
			  <div class="tabbable tabs-left">
				  
				  <ul class="nav nav-tabs">
					<li><h4><?php echo $rowOption['nomoption'];?></h4>
					 <p>Groupes :  <span class="badge badge-info"><?php echo $rowOption['nbgroupestd'];?></span></p>
					 <p>Promotion : <span class="badge badge-warning">8</span></p>
					 <a class="label label-success" href="modifier_option.php?id=<?php echo $rowOption['idoption']; ?>">Modifier</a> 
	<a class="label label-important" href="#" onclick="suppr_option(<?php echo $rowOption['idoption']; ?>,<?php echo $i; ?>,<?php echo $row["idformation"]; ?>);">Supprimer</a>				<li>
				  </ul>
				  
				  <div class="tab-content"> 
						   
						  
						 
<div id="table_enseignement">
							<table class="table table-striped">
							   
							   
							    <thead>
								<tr>
								<th>Enseignement</th>
								<th>Code</th>
								<th>Date Début</th>
								<th>Date Fin</th>
								</tr>
								</thead>
								<tbody>

									<?php
									  $req3 = getEnseignement($row["idformation"],$rowOption["idoption"]);
									  while($rowEnseignement = pg_fetch_assoc($req3)){
									?>
							    <tr>
								<td><a href="enseignement_detail.php?id=<?php echo $rowEnseignement['id']; ?> "><?php echo $rowEnseignement['nom']; ?> </a> <a href="modifier_enseignement.php?id=<?php echo $rowEnseignement['id']; ?> ">Modifier</a> <a href="#" onclick="suppr_enseignement(<?php echo $rowEnseignement['id']; ?>);">Supprimer</a></td>
								<td><?php echo $rowEnseignement['code']; ?></td>
								<td><?php echo $rowEnseignement['debut']; ?></td>
								<td><?php echo $rowEnseignement['fin']; ?></td>
								
								</tr>
								<?php }  ?>
								</tbody>
							   

						   </table>
					</div>	  
				   </div>
				   
			   </div>
			<?php } ?>
</div>
</div>
